package com.zhuangjie.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhuangjie.order.data.OrderStateCount;
import com.zhuangjie.order.dto.OrderListForUserPageDTO;
import com.zhuangjie.order.dto.ShopOrderPageDTO;
import com.zhuangjie.order.entity.Order;
import com.zhuangjie.order.vo.OrderForMapShow;
import com.zhuangjie.order.vo.OrderForUserVO;
import com.zhuangjie.order.vo.ShopOrderVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 订单表 Mapper 接口
 * </p>
 *
 * @author zhuangjie
 * @since 2023-11-24
 */
@Repository
public interface OrderMapper extends BaseMapper<Order> {

    Page<ShopOrderVO> selectShopOrder(@Param("page") Page<ShopOrderVO> page, @Param("shopId") Long shopId, @Param("condition") ShopOrderPageDTO shopOrderPageDTO);

    List<OrderStateCount> selectStatesCount(@Param("shopId") Long shopId, @Param("excludes") List<Integer> excludeStateList);

    Page<OrderForUserVO> selectOrderPageForUser(@Param("userId") Long currentUserId, @Param("page") Page<OrderForUserVO> objectPage, @Param("condition") OrderListForUserPageDTO orderListForUserPageDTO);

    OrderForMapShow selectOneMapShowOrderInfo(@Param("userId") Long userId, @Param("orderId") Long orderId, @Param("deliveryBusinessType") String deliveryBusinessType, @Param("selfPickupBusinessType") String selfPickupBusinessType, @Param("selectBeginOrderState") int selectBeginOrderState, @Param("selectEndOrderState") int selectEndOrderState);
}
